<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
            *{
                margin: 0px;
                padding: 0px;
                list-style: none;
            }
            textarea{
                width: 500px;
                margin:10px auto;
                display: block;
                resize: none;
                outline: none;
            }
            button{
                width: 500px;
                margin:10px auto;
                display: block;
                background:#f60;
                border: none;
                cursor: pointer;
                line-height: 40px;
                color:white;
            }
            ul{
                width: 500px;
                margin:10px auto;
                display: block;
            }
            li{
                background:rgba(144, 219, 238, 0.767);
                padding:10px;
                margin-bottom: 10px;
                position: relative;
            }
            span{
                position: absolute;
                right: -5px;
                top:-5px;
                cursor: pointer;
            }
        </style>
    </head>
    <body>
        <textarea name="" id="a" cols="30" rows="10"></textarea>
        <button id="b">发布微博</button>
       <ul id="c">
          <!-- <li>
                儿童节快乐
                <p>2021-06-01</p>
                <span onclick="del(this)">删除</span>
            </li> --> 
        </ul>
        <script>
            var c=document.getElementById('c')
            var a=document.getElementById('a')
            var b=document.getElementById('b')
            b.onclick=function(){
                var tag=document.createElement('li');
                tag.innerHTML=`${a.value}
                <p>2021-06-15</p>
                <span onclick="del(this)">删除</span>`;
                c.appendChild(tag)
                a.value='';
            }
            function del(a){
                a.parentNode.parentNode.removeChild(a.parentNode)
            }
        </script>
    </body>
</html>